<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
    <%--不能自闭和--%>
    <script src="${pageContext.request.contextPath}/statics/js/jquery-3.6.0.js"></script>
    <script>
      /*$.==jQuery.*/
      function a1() {
        $.post({
          url:"${pageContext.request.contextPath}/a1",
          data:{'name':$("#username").val()},
          success:function (data,status) {
            alert(data);
            alert(status);
            console.log("data"+data);
          }
        })
      }
    </script>
  </head>
  <body>

  <%--失去焦点的时候，发起一个请求到后台--%>
  用户名：<input type="text" id="username" onblur="a1()">
  </body>
</html>
